<template>
  <div class='content'>
    <div class="top">
      <el-input v-model="serchVal" placeholder="请输入内容"></el-input>
      <el-select v-model="inventoryType" placeholder="请选择库存类型">
        <el-option label="平台直营" value="live"></el-option>
        <el-option label="商家寄存" value="food"></el-option>
      </el-select>
      <el-button type="primary" size="medium">搜索</el-button>
    </div>
    <div class="tables">
      <el-table :data="tableData" stripe style="width: 100%">
        <!-- 设置表头数据源，并循环渲染出来，property对应列内容的字段名 -->
        <el-table-column v-for="info in rightHeader" :key="info.key" :property="info.key" :label="info.label"
          align="center">
          <template slot-scope="scope">
             <!-- 渲染对应表格里面的内容 -->
            {{scope.row[scope.column.property]}}
          </template>
        </el-table-column>
        <el-table-column prop="set" label="操作" width="300" fixed="right" align="center">
          <template slot-scope="scope">
            <el-button type="danger" size="small">取消商家资格</el-button>
             <el-button @click="details(scope.row)" type="primary" size="small">查看详情</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="pages">
      <el-pagination background layout="prev, pager, next" :page-size="10" :total="100"
        @current-change="handleCurrentChange">
      </el-pagination>
    </div>
  </div>
</template>

<script>
  export default {
    //import引入的组件需要注入到对象中才能使用
    components: {},
    data() {
      //这里存放数据
      return {
        serchVal: null,
        inventoryType: null,
        rightHeader: [
          {
              key:'id',
              label:'编号'
            },
            {
              key:'shopName',
              label:'商家名'
            },
            {
              key:'date',
              label:'申请时间'
            },
            {
              key:'type',
              label:'入驻类型'
            },

        ],
        tableData: [{

          id: '89757',
          shopName: '商家1',
          date: '2019-12-27',
          type: '商家寄存',
        }, ]
      };
    },
    //监听属性 类似于data概念
    computed: {},
    //监控data中的数据变化
    watch: {},
    //方法集合
    methods: {
      handleClick(e) {
        console.log(e)
      },
      handleCurrentChange(e) {
        console.log(e)
      },
      details(val){
       this.$router.push({path:'/sellerManger/hasJoin/Details'})
      }
    },
    //生命周期 - 创建完成（可以访问当前this实例）
    created() {

    },
    //生命周期 - 挂载完成（可以访问DOM元素）
    mounted() {

    },
    beforeCreate() {}, //生命周期 - 创建之前
    beforeMount() {}, //生命周期 - 挂载之前
    beforeUpdate() {}, //生命周期 - 更新之前
    updated() {}, //生命周期 - 更新之后
    beforeDestroy() {}, //生命周期 - 销毁之前
    destroyed() {}, //生命周期 - 销毁完成
    activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
  }

</script>
<style lang='scss' scoped>
  @import '~@/styles/chow.scss';

</style>
